System.register([],
    function(n, t) {
        "use strict";
        function i(n, t, i) {
            return t in n ? Object.defineProperty(n, t, {
                value: i,
                enumerable: !0,
                configurable: !0,
                writable: !0
            }) : n[t] = i,
            n
        }
        function r(n) {
            function h(n) {
                var e = n.findCanvas,
                t, i;
                return Promise.resolve().then(function() {
                    return r("./cc.js")
                }).then(function(n) {
                    return i = n,
                    p(),
                    y(i)
                }).then(function() {
                    return t = window._CCSettings,
                    u(i, t, e).then(function() {
                        if (t.scriptPackages) return a(t.scriptPackages)
                    }).then(function() {
                        return v(t.jsList)
                    }).then(function() {
                        return c(t.hasResourcesBundle, t.hasStartSceneBundle)
                    }).then(function() {
                        return i.game.run(function() {
                            return f(i, t)
                        })
                    })
                })
            }
            function r(n) {
                return t["import"]("".concat(n))
            }
            function c(n, t) {
                var o = Promise.resolve(),
                i = cc.AssetManager.BuiltinBundleName,
                r = i.MAIN,
                f = i.RESOURCES,
                e = i.START_SCENE,
                u = n ? [f, r] : [r];
                return t && u.push(e),
                u.reduce(function(n, t) {
                    return n.then(function() {
                        return l(t)
                    })
                },
                Promise.resolve())
            }
            function l(n) {
                return new Promise(function(t, i) {
                    cc.assetManager.loadBundle(n,
                    function(n, r) {
                        if (n) return i(n);
                        t(r)
                    })
                })
            }
            function a(n) {
                return Promise.all(n.map(function(n) {
                    return r(n)
                }))
            }
            function v(n) {
                var t = Promise.resolve();
                return n.forEach(function(n) {
                    t = t.then(function() {
                        return o("src/".concat(n))
                    })
                }),
                t
            }
            function y() {
                return new Promise(function(n) {
                    window._CCSettings = jsonSettings;
                    window._CCSettings.server = "";
                    n()
                })
            }
            function p() {
                function r(n) {
                    for (var i = atob(n), t = i.length, r = new Uint8Array(t); t--;) r[t] = i.charCodeAt(t);
                    return r
                }
                function n(n, t, i, r) {
                    function u() {
                        r.removeEventListener("load", u);
                        r.removeEventListener("error", f);
                        i(null, r)
                    }
                    function f() {
                        r.removeEventListener("load", u);
                        r.removeEventListener("error", f);
                        i(new Error("Load image (" + n + ") failed"))
                    }
                    var e = window.resMap[n],
                    r = new Image;
                    r.addEventListener("load", u);
                    r.addEventListener("error", f);
                    r.src = e
                }
                function f(n, t, i) {
                    let r = window.resMap[n];
                    i(null, r)
                }
                function e(n, t, i) {
                    let u = window.resMap[n],
                    f = r(u);
                    i(null, f)
                }
                function t(n, t, i) {
                    var f = new(window.AudioContext || window.webkitAudioContext),
                    u = window.resMap[n];
                    u = r(u);
                    f.decodeAudioData(u.buffer,
                    function(n) {
                        i(null, n)
                    },
                    function(n) {
                        i(n, null)
                    })
                }
                function o(n) {
                    var t = `. / $ {
                        n
                    }`;
                    System.preload(t, window.resMap[n]);
                    System.import(t)
                }
                function u(n, t, i) {
                    let r = window.resMap[n];
                    r = JSON.parse(r);
                    i(null, r)
                }
                function s(n, t, r) {
                    var e, l;
                    let f = cc.path.basename(n);
                    e = t.version || cc.assetManager.downloader.bundleVers[f];
                    let h = e ? e + ".": "",
                    c = `assets / $ {
                        f
                    }`,
                    s = `assets / $ {
                        f
                    }
                    /index.${h}js`;i[s]||(o(s),i[s]=!0);t.__cacheBundleRoot__=f;l=`${c}/config.$ {
                        h
                    }
                    json`;
                    u(l, t,
                    function(n, t) {
                        if (n) {
                            r && r(n);
                            return
                        }
                        t.base = c + "/";
                        r && r(null, t)
                    })
                }
                function h(n) {
                    var t = n.lastIndexOf(".ttf"),
                    i;
                    return (t === -1 && (t = n.lastIndexOf(".tmp")), t === -1) ? n: (i = n.lastIndexOf("/"), i === -1 ? n.substring(0, t) + "_LABEL": n.substring(i + 1, t) + "_LABEL")
                }
                function c(n, t, i) {
                    let r = h(n),
                    u = 'url(data:application/x-font-woff;charset=utf-8;base64,PASTE-BASE64-HERE) format("woff")';
                    u = u.replace("PASTE-BASE64-HERE", window.resMap[n]);
                    let f = new FontFace(r, u);
                    document.fonts.add(f);
                    f.load();
                    f.loaded.then(function() {
                        i(null, r)
                    },
                    function() {
                        cc.warnID(4933, r);
                        i(null, r)
                    })
                }
                function l(n, t, i) {
                    i(null)
                }
                const i = {},
                a = cc.assetManager.downloader;
                cc.assetManager.downloader.register("bundle", s);
                cc.assetManager.downloader.register(".png", n);
                cc.assetManager.downloader.register(".jpg", n);
                cc.assetManager.downloader.register(".jpeg", n);
                cc.assetManager.downloader.register(".ttf", c);
                cc.assetManager.downloader.register(".plist", f);
                cc.assetManager.downloader.register(".json", u);
                cc.assetManager.downloader.register(".bin", e);
                cc.assetManager.downloader.register(".mp3", t);
                cc.assetManager.downloader.register(".ogg", t);
                cc.assetManager.downloader.register(".wav", t);
                cc.assetManager.downloader.register(".mp4", l)
            }
            var o = n.loadJsListFile,
            s = n.fetchWasm,
            e = Promise.resolve();
            if (window.ammoEngine) {
                e.then(function() {
                    return r("./wait-for-ammo-instantiation.js")
                }).then(function(n) {
                    var t = n["default"],
                    i = t.isWasm,
                    r = t.wasmBinaryURL;
                    return i ? Promise.resolve(s(r)).then(function(n) {
                        return t(n)
                    }) : t()
                })
            }
            return e = e.then(function() {
                return i({
                    start: h
                },
                "import", r)
            })
        }
        function u(n, t, i) {
            var r, u;
            if (t.macros) for (r in t.macros) n.macro[r] = t.macros[r];
            return u = e(t, i),
            Promise.resolve(n.game.init(u))
        }
        function f(n, t) {
            window._CCSettings = undefined;
            n.view.enableRetina(!0);
            n.view.resizeWithBrowserSize(!0);
            n.sys.isMobile && (t.orientation === "landscape" ? n.view.setOrientation(n.macro.ORIENTATION_LANDSCAPE) : t.orientation === "portrait" && n.view.setOrientation(n.macro.ORIENTATION_PORTRAIT), n.view.enableAutoFullScreen(!1));
            var i = t.launchScene;
            n.director.loadScene(i, null,
            function() {
                n.view.setDesignResolutionSize(640, 960, 3);
                console.log("Success to load scene: ".concat(i))
            })
        }
        function e(n, t) {
            var i = {
                bundleVers: n.bundleVers,
                remoteBundles: n.remoteBundles,
                server: n.server,
                subpackages: n.subpackages
            };
            return {
                debugMode: n.debug ? 1 : 3,
                showFPS: !0 && n.debug,
                frameRate: 60,
                groupList: n.groupList,
                collisionMatrix: n.collisionMatrix,
                renderPipeline: n.renderPipeline,
                adapter: t("GameCanvas"),
                assetOptions: i,
                customJointTextureLayouts: n.customJointTextureLayouts || [],
                physics: n.physics
            }
        }
        return n("createApplication", r),
        {
            setters: [],
            execute: function() {}
        }
    })